<?php
include_once "topo.php";

$inscricao = new inscricao();
if(valida::cpf($_GET["cod"])){
    $cod = ext_0($_GET["cod"]);
    $inscricao->carregar($cod);
}else{
    $cod = '';
}

if($_POST["btn_ok"] == "Ok"){
    $cpf = $_POST["cpf"];
    if(valida::cpf($cpf)){
        $inscricao->carregar($cpf);
        $cod = $inscricao->get_cpf();
    }
}
?>
                <div id="form_boleto">
                    <form action="certificadoPrint.php" method="post">
                        <label>CPF</label>
                        <input type="number" name="cpf" value="<?php echo $inscricao->get_cpf(); ?>" id="cpf" onBlur="if(!valida.cpf(this.value)){erro(this.id)}" onFocus="clean(this.id)" OnKeyUp="apenas_num(this)">
                        <input type="submit" name="btn_ok" value="Ok">
                    </form>
                </div>
<?php
unset($inscricao);
include_once "rodape.php";
?>
